package com.mallcai.bigdata.ladon.dpl.mapper.report;

import com.mallcai.bigdata.ladon.dpl.entity.dashboard.SqlRunLogStatic;
import com.mallcai.bigdata.ladon.dpl.entity.report.SqlRunLog;
import com.mallcai.bigdata.ladon.dpl.mapper.report.provider.SqlRunLogSqlProvider;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author gst
 * @date 2019-12-30 20:36
 */
@Repository
public interface SqlRunLogMapper {
    @InsertProvider(type = SqlRunLogSqlProvider.class, method = "insert")
    int insert(SqlRunLog sqlRunLog);

    @UpdateProvider(type = SqlRunLogSqlProvider.class, method = "update")
    int update(SqlRunLog sqlRunLog);

    @UpdateProvider(type = SqlRunLogSqlProvider.class, method = "delete")
    int delete(SqlRunLog sqlRunLog);

    @SelectProvider(type = SqlRunLogSqlProvider.class, method = "findById")
    SqlRunLog findById(@Param("id") Long id);

    @SelectProvider(type = SqlRunLogSqlProvider.class, method = "getByParams")
    List<SqlRunLog> getByParams(@Param("params") Map<String, Object> params);

    @SelectProvider(type = SqlRunLogSqlProvider.class, method = "getRunLogStatic")
    List<SqlRunLogStatic> getRunLogStatic();

    @SelectProvider(type = SqlRunLogSqlProvider.class, method = "getYesterdayRunLogStatic")
    List<SqlRunLogStatic> getYesterdayRunLogStatic();

    @UpdateProvider(type = SqlRunLogSqlProvider.class, method = "deleteLogOneWeekAgo")
    int deleteLogOneWeekAgo();

    @SelectProvider(type = SqlRunLogSqlProvider.class, method = "getTodayVisitSize")
    int getTodayVisitSize();
}
